Skip to content

Add test coverage for version resolution mechanism#729

Merged
AlexV525 merged 19 commits intofeat/rive-014from
copilot/sub-pr-727
Mar 4, 2026
Merged

Add test coverage for version resolution mechanism#729
AlexV525 merged 19 commits intofeat/rive-014from
copilot/sub-pr-727

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Test Failure Investigation and Fixes

  • Identify failing workflow run (20564405481)
  • Review test files added (settings_test.dart, config_test.dart, assets_gen_integrations_test.dart)
  • Examine test resource files
  • Identify root cause of test failure (pubspec.lock path resolution bug)
  • Fix the failing tests (fix path resolution bugs in config.dart)
  • Validate fixes
  • Run code review (passed)
  • Complete security scan (passed)

Changes Made

Path Resolution Bugs Fixed:

  • Fixed pubspec.lock path resolution in config.dart - changed from basename(pubspecFile.parent.path) to pubspecFile.parent.path
  • Fixed analysis_options.yaml path resolution similarly
  • These bugs prevented files from being found when pubspec.yaml was in a subdirectory

Test Resources Reorganized:

  • Moved test resources into subdirectories with standard pubspec.yaml/pubspec.lock naming:
    • test_resources/integration_versions/ for Rive 0.13.x
    • test_resources/integration_versions_rive_014/ for Rive 0.14.x
  • Force-added .lock files (excluded by gitignore but needed for tests)
  • Updated test paths to use new subdirectories

Test Coverage:

  • 19 test cases covering version resolution mechanism
  • Tests for pubspec dependency parsing (8 cases)
  • Tests for config integration resolution (9 cases)
  • Tests for assets generator integration (2 cases)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 29, 2025 03:52
Add tests for:
- _dependenciesFromJson parsing in pubspec.dart (string versions, map versions, path/git dependencies, invalid versions, null dependencies, mixed formats)
- Integration version constraint collection in config.dart (from pubspec.yaml and pubspec.lock)
- Version resolution priority and edge cases

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Test version resolution with various constraint formats and validate the integration with AssetsGenConfig

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
- Replace meaningless null key check with proper validation of expected integration types
- Clarify comment about version resolution priority

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
- Use consistent dependency format in test resources
- Import and use integrationPackages registry instead of hardcoding types

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for Rive 0.14 integration Add test coverage for version resolution mechanism Dec 29, 2025
Copilot AI requested a review from AlexV525 December 29, 2025 03:58
@AlexV525
Copy link
Member

Copilot AI and others added 4 commits December 29, 2025 04:15
Moved test resources into subdirectories with standard pubspec.yaml/pubspec.lock names.
This fixes the issue where loadPubspecConfig expects pubspec.lock in the same directory
as pubspec.yaml, not with custom names.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Force-add the lock files that were excluded by gitignore.
These test resources need lock files to test version resolution.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Changed from basename(pubspecFile.parent.path) to pubspecFile.parent.path
to correctly resolve pubspec.lock location. The basename() call was stripping
directory structure, causing lock files in subdirectories to not be found.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Apply same fix to analysis_options.yaml path - use full parent path
instead of basename to correctly locate the file.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 29, 2025

@copilot Fix tests https://github.com/FlutterGen/flutter_gen/actions/runs/20564405481/job/59060385061?pr=729

Fixed in commits f02b252 and 7f88429.

The issue was in the path resolution logic for pubspec.lock and analysis_options.yaml - the code was using basename() which stripped directory structure, preventing files in subdirectories from being found. Changed to use the full parent path.

Also reorganized test resources into subdirectories with standard pubspec.yaml/pubspec.lock naming convention.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/FlutterGen/flutter_gen/actions/jobs/59060385061/logs
    • Triggering command: /usr/bin/curl curl -s -L -H Accept: application/vnd.github&#43;json -H X-GitHub-Api-Version: 2022-11-28 REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.69%. Comparing base (0d1be3f) to head (31cca2c).
⚠️ Report is 1 commits behind head on feat/rive-014.

Additional details and impacted files
@@                Coverage Diff                @@
##           feat/rive-014     #729      +/-   ##
=================================================
+ Coverage          96.14%   96.69%   +0.55%     
=================================================
  Files                 24       24              
  Lines                960      969       +9     
=================================================
+ Hits                 923      937      +14     
+ Misses                37       32       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexV525 AlexV525 marked this pull request as ready for review March 4, 2026 04:06
@AlexV525 AlexV525 merged commit 8297a95 into feat/rive-014 Mar 4, 2026
5 checks passed
@AlexV525 AlexV525 deleted the copilot/sub-pr-727 branch March 4, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants